<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:composition template="/view/retail/template.xhtml">
        <ui:define name="content">
            <f:view>
                <h1 class="ui-widget-header ui-corner-all">#{contactManager.editContactTitle}</h1>
                <h:form>
                    <h:panelGrid columns="4" width="100%" title="基本信息" headerClass="subtitlebig" styleClass="ui-widget-content">
                        <f:facet name="header" id="header">
                            <h:outputText value="基本信息" styleClass="ui-widget-header ui-corner-all"/>
                        </f:facet>
                        <h:outputLabel value="姓氏" for="surname" />
                        <h:panelGroup >
                            <h:inputText id="surname" value="#{contactManager.currentContact.surname}" title="Surname" />
                            <h:selectOneMenu value="#{contactManager.currentContact.saluation}">
                                <f:selectItem itemLabel="先生" itemValue="先生"/>
                                <f:selectItem itemLabel="女士" itemValue="女士"/>
                            </h:selectOneMenu>
                        </h:panelGroup>
                        <h:outputLabel value="名字:" for="name" />
                        <h:inputText id="name" value="#{contactManager.currentContact.name}" title="Name" />
                        <h:outputLabel value="公司" for="company" />
                        <h:inputText id="company" value="#{contactManager.currentContact.company}"  style="width:180px" title="Company" />
                        <h:outputLabel value="生日" for="birthday" />
                        <p:calendar  id ="birthday" value="#{contactManager.currentContact.birthday}" navigator="true"  ></p:calendar>
                        <h:outputLabel value="结婚日期" for="marriageDate" />
                        <p:calendar  id ="marriageDate" value="#{contactManager.currentContact.marriageDate}" navigator="true"  ></p:calendar>

                        <h:outputLabel value="mobilePhone" for="mobilePhone" />
                        <h:inputText id="mobilePhone" value="#{contactManager.currentContact.mobilePhone}" title="MobilePhone" />
                        <h:outputLabel value="homePhone" for="homePhone" />
                        <h:inputText id="homePhone" value="#{contactManager.currentContact.homePhone}" title="homePhone" />
                        <h:outputLabel value="address" for="address" />
                        <h:inputText id="address" value="#{contactManager.currentContact.address}" title="address" />
                    </h:panelGrid>
                    <h:panelGroup>
                        <p:commandButton value="保存" ajax="false"  action="#{contactManager.save}"></p:commandButton>
                        <p:commandButton value="取消" ajax="false"  action="#{contactManager.currentContact.id} ==null?show:detail"></p:commandButton>
                    </h:panelGroup>
                </h:form>
            </f:view>
        </ui:define>
    </ui:composition>
</html>
